home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / lib / partman / fstab.d / basic next >
Text File  |  2009-10-06  |  2KB  |  81 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4.  
  5. utf8=
  6. if db_get debian-installer/locale; then
  7.     # TODO: This check breaks for locales that use the UTF-8 encoding but
  8.     # whose names don't include ".UTF-8". This is difficult to fix without
  9.     # adding more encoding intelligence to localechooser. In the meantime,
  10.     # we hardcode certain such non-obvious UTF-8 locales known to be used in
  11.     # localechooser.
  12.     case $RET in
  13.         *.UTF-8|bn_BD|dz_BT|gu_IN|hi_IN|km_KH|ml_IN|ne_NP|pa_IN|se_NO|ta_IN|vi_VN|wo_SN)
  14.         utf8=1
  15.         ;;
  16.     esac
  17. fi
  18.  
  19. for dev in $DEVICES/*; do
  20.     [ -d $dev ] || continue
  21.     cd $dev
  22.     open_dialog PARTITIONS
  23.     while { read_line num id size type fs path name; [ "$id" ]; }; do
  24.         [ $fs != free ] || continue
  25.         [ -f "$id/method" ] || continue
  26.         method=$(cat $id/method)
  27.         if [ "$method" = swap ]; then
  28.             echo "$path" none swap sw 0 0
  29.         fi
  30.         [ -f "$id/acting_filesystem" ] || continue
  31.         filesystem=$(cat $id/acting_filesystem)
  32.         case "$filesystem" in
  33.             ext2)
  34.             [ -f "$id/mountpoint" ] || continue
  35.             mountpoint=$(cat $id/mountpoint)
  36.             # due to #249322, #255135, #258117:
  37.             if [ "$mountpoint" = /tmp ]; then
  38.                 rm -f $id/options/noexec
  39.             fi
  40.             options=$(get_mountoptions $dev $id)
  41.             if [ "$mountpoint" = / ]; then
  42.                 if [ "$options" = defaults ]; then
  43.                     options="errors=remount-ro"
  44.                 else
  45.                     options="${options},errors=remount-ro"
  46.                 fi
  47.                 pass=1
  48.             else
  49.                 pass=2
  50.             fi
  51.             echo "$path" "$mountpoint" ext2 $options 0 $pass
  52.             ;;
  53.             fat16|fat32)
  54.             [ -f "$id/mountpoint" ] || continue
  55.             mountpoint=$(cat $id/mountpoint)
  56.             options=$(get_mountoptions $dev $id)
  57.             if [ "$utf8" ]; then
  58.                 if [ "$options" = defaults ]; then
  59.                     options="utf8"
  60.                 else
  61.                     options="$options,utf8"
  62.                 fi
  63.             fi
  64.             # base-passwd defines gid 46 as group plugdev
  65.             echo "$path" "$mountpoint" vfat $options,umask=007,gid=46 0 1
  66.             ;;
  67.             ntfs)
  68.             [ -f "$id/mountpoint" ] || continue
  69.             mountpoint=$(cat $id/mountpoint)
  70.             options=$(get_mountoptions $dev $id)
  71.             if [ "$utf8" ] && [ ! -f /var/lib/partman/ntfs-3g ]; then
  72.                 options="$options,nls=utf8"
  73.             fi
  74.             # base-passwd defines gid 46 as group plugdev
  75.             echo "$path" "$mountpoint" ntfs $options,umask=007,gid=46 0 0
  76.             ;;
  77.         esac
  78.     done
  79.     close_dialog
  80. done
  81.